package study.mq.rocketmq.consumer.consumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 消费模式
 * （1）集群
 * （2）广播
 */
@Slf4j
@Component
@RocketMQMessageListener(topic = "message_topic",
        consumerGroup = "message_group",
        messageModel = MessageModel.BROADCASTING)
public class _03_MessageModelConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        log.info(">>>>>> {}", message);
    }
}
